package pl.vanta.utils.commons.validators;

import java.util.List;

public abstract class AbstractValidator<T> implements Validator<T>
{
	@Override
	public boolean validate(T object)
	{
		return validateWithErrors(object).isEmpty();
	}

	public String validateWithError(T object)
	{
		List<String> errors = validateWithErrors(object);

		if (errors.isEmpty())
		{
			return "";
		}
		else
		{
			return errors.toString();
		}
	}
}